package com.dt76.smallloanbackenduser.controller.afterloan;


import com.dt76.smallloanbackenduser.pojo.afterloan.PrepaymentCommitInfo;
import com.dt76.smallloanbackenduser.remote.afterloan.PrepaymentRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;


@Controller
public class PrepaymentController {

    @Autowired
    private PrepaymentRemote prepaymentRemote;

    @GetMapping("/prepaymentManager")
    public String jumpToRepayment() {
        return "/pages/afterloan/prepaymentManager";
    }


    @ResponseBody
    @PostMapping("/prepayment/commitNormal/{loanId}")
    public Map<String, Object> commitRepaymentConfirm(@RequestBody PrepaymentCommitInfo q, @PathVariable Integer loanId) {
        return prepaymentRemote.commitRepaymentConfirm(q, loanId);
    }
}
